import Vue from 'vue'
import App from './App.vue'
// 引入路由配置
import router from './router'
// import './plugins/element.js'
import './assets/css/global.css'
import TreeTable from 'vue-table-with-tree-grid'
import axios from 'axios'
import VueQuillEditor from 'vue-quill-editor' // 富文本编辑器
// import 'quill/dist/quill.core.css' // import styles
// import 'quill/dist/quill.snow.css' // for snow theme
// import 'quill/dist/quill.bubble.css' // for bubble theme
import NProgress from 'nprogress'
// import 'nprogress/nprogress.css'
Vue.config.productionTip = false

axios.defaults.baseURL = 'http://www.jinglingdan.top:9999/api/private/v1/'
// 请求开始展示进度条
axios.interceptors.request.use(config => {
  // console.log(config)
  NProgress.start()
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
// 请求结束隐藏进度条
axios.interceptors.response.use(config => {
  NProgress.done()
  return config
})
Vue.prototype.$http = axios
Vue.component('tree-table', TreeTable)
Vue.use(VueQuillEditor)
Vue.filter('dataFormat', function(nS) {
  const createdtime = new Date(nS)

  const y = createdtime.getFullYear()
  const m = (createdtime.getMonth() + 1 + '').padStart(2, '0')
  const d = (createdtime.getDate() + '').padStart(2, '0')
  const hh = (createdtime.getHours() + '').padStart(2, '0')
  const mm = (createdtime.getMinutes() + '').padStart(2, '0')
  const ss = (createdtime.getSeconds() + '').padStart(2, '0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
console.log(1)
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
